package com.qinyeit.webapp.controller.management.report;

import com.qinyeit.serviceapp.entity.MerchantGroup;
import com.qinyeit.serviceapp.service.organization.MerchantGroupService;
import com.qinyeit.webapp.controller.management.BaseManagementController;
import com.qinyeit.webapp.utils.CurrentAccountUtils;
import com.qinyetech.springstage.core.lang.QyMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/management/baseInfo")
public class HomeController extends BaseManagementController {

    @Autowired
    private MerchantGroupService merchantGroupService;

    @RequestMapping("/today")
    public Object today(){
        Long merchantGroupId = CurrentAccountUtils.getAuthenticatedMerchantGroupID();
        MerchantGroup merchantGroup = merchantGroupService.findById(merchantGroupId);
        QyMap map = QyMap.NEW();
        map.setv("merchantGroupId", "LS"+(merchantGroupId+10000));
        map.setv("merchantGroupName", merchantGroup.getCompanyName());

        return ok("查询成功", map);
    }



    @RequestMapping("/isLogin")
    public Object isLogin(){
        return ok("您已登陆");
    }



}
